package com.itheima.controller;

import com.itheima.CommonResult;
import com.itheima.dtos.WmNewsDto;
import com.itheima.service.WmNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangjiexin
 */
@RestController
@RequestMapping("/api/v1/news")
public class WmNewsController {
    @Autowired
    WmNewsService wmNewsService;
    @PostMapping("/submit")
    public CommonResult submitNews(@RequestBody WmNewsDto dto){
        //文章发布 夹杂图片模式的选择

        return CommonResult.success(wmNewsService.submitNews(dto));
    }
}
